package dp_algorithm.nowcoder.medium;

/**
 * @author bruin_du
 * @description 年终奖
 * https://www.nowcoder.com/practice/72a99e28381a407991f2c96d8cb238ab?
 * tpId=49&&tqId=29305&rp=1&ru=/activity/oj&qru=/ta/2016test/question-ranking
 * @date 2022/5/21 9:32
 **/
public class GetMost {
    public int getMost(int[][] board) {
        int[][] dp = new int[7][7];
        for (int i = 1; i < dp.length; i++) {
            for (int j = 1; j < dp[0].length; j++) {
                dp[i][j] = Math.max(dp[i - 1][j],dp[i][j - 1]) + board[i - 1][j - 1];
            }
        }
        return dp[6][6];
    }
}
